# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.FusionTables.V2.Model.Template do
  @moduledoc """
  Represents the contents of InfoWindow templates.

  ## Attributes

  *   `automaticColumnNames` (*type:* `list(String.t)`, *default:* `nil`) - List of columns from which the template is to be automatically constructed. Only one of body or automaticColumns can be specified.
  *   `body` (*type:* `String.t`, *default:* `nil`) - Body of the template. It contains HTML with {column_name} to insert values from a particular column. The body is sanitized to remove certain tags, e.g., script. Only one of body or automaticColumns can be specified.
  *   `kind` (*type:* `String.t`, *default:* `fusiontables#template`) - The kind of item this is. For a template, this is always fusiontables#template.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Optional name assigned to a template.
  *   `tableId` (*type:* `String.t`, *default:* `nil`) - Identifier for the table for which the template is defined.
  *   `templateId` (*type:* `integer()`, *default:* `nil`) - Identifier for the template, unique within the context of a particular table.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :automaticColumnNames => list(String.t()),
          :body => String.t(),
          :kind => String.t(),
          :name => String.t(),
          :tableId => String.t(),
          :templateId => integer()
        }

  field(:automaticColumnNames, type: :list)
  field(:body)
  field(:kind)
  field(:name)
  field(:tableId)
  field(:templateId)
end

defimpl Poison.Decoder, for: GoogleApi.FusionTables.V2.Model.Template do
  def decode(value, options) do
    GoogleApi.FusionTables.V2.Model.Template.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.FusionTables.V2.Model.Template do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
